#ifndef LRCFORM_H
#define LRCFORM_H

#include "qpropertyanimation.h"
#include <QWidget>

namespace Ui {
class lrcForm;
}


struct Lrcline
{
public:
    qint64 time;
    QString text;
    Lrcline(qint64 time, QString text):time(time), text(text){}
};
bool operator <(const Lrcline& A, const Lrcline& B);

class lrcForm : public QWidget
{
    Q_OBJECT

public:
    explicit lrcForm(QWidget *parent = nullptr);
    ~lrcForm();

    void setTitle(QString title);
    void setAuthor(QString author);
    void setAlbum(QString album);
    void clear();
    bool parseLrc(QString path);
    int getIndex(qint64 pos);
    void showLrc(qint64 pos);
    QString getLrcText(int index);


private:
    Ui::lrcForm *ui;
    // 隐藏动画
    QPropertyAnimation * lrcAnimetionhide;
    // 歌词容器
    std::vector<Lrcline> lines;
};

#endif // LRCFORM_H
